package com.fac.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fac.constant.UserType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("users")
@ApiModel(description = "用户实体类")
public class Users implements Serializable {

    @TableId(value = "user_id", type = IdType.AUTO)
    @ApiModelProperty(value = "用户ID", example = "1")
    private Long userId;

    @ApiModelProperty(value = "用户名", example = "zhangsan")
    private String username;

    @TableField(value = "password", select = false)
    @ApiModelProperty(value = "密码", hidden = true)
    private String password;

    @ApiModelProperty(value = "用户类型", example = "WORKER", allowableValues = "WORKER,RENTAL_FACTORY,BORROWING_FACTORY,REPAIR_FACTORY,ADMIN")
    private UserType userType;

    @ApiModelProperty(value = "真实姓名", example = "张三")
    private String realName;

    @ApiModelProperty(value = "手机号", example = "13800138000")
    private String mobile;

    @ApiModelProperty(value = "邮箱", example = "zhangsan@example.com")
    private String email;

    @ApiModelProperty(value = "状态：1启用，0禁用", example = "1")
    private Integer status;

    @ApiModelProperty(value = "最后登录时间", example = "2024-01-01 12:00:00")
    private LocalDateTime lastLoginTime;

    @ApiModelProperty(value = "创建时间", example = "2024-01-01 12:00:00")
    private LocalDateTime createdAt;

    @ApiModelProperty(value = "更新时间", example = "2024-01-01 12:00:00")
    private LocalDateTime updatedAt;

    @ApiModelProperty(value = "微信openid", example = "oxxx...")
    private String openid;
}